#include<stdio.h>
//1.3顺序结构
//三位数反转
int main()
{   
	int n, m;
	scanf_s("%d", &n);
	m = (n % 10) * 100 + (n / 10 % 10) * 10 + (n / 100);
	printf("%03d\n", m);  // 3表示最小输出3位数字，0表示如果数字不足3位，在左边用0补成3位
	printf("%d%d%d\n", n % 10, n / 10 % 10, n / 100);
	return 0;
}

//交换变量
//方法一：三变量法
int main()
{
	int a, b, temp;
	scanf_s("%d%d", &a, &b);
	temp = a;a = b;b = temp;
	printf("a=%d b=%d\n", a, b);
	return 0;
}
//方法二：（最合适、最简单）
int main()
{
	int a, b;
	scanf_s("%d%d", &a, &b);
	printf("%d %d\n", b, a);
	return 0;
}


//1.4分支结构
//鸡兔同笼
int main()
{
	int a, b, n, m;
	scanf_s("%d%d", &n, &m);
	a = (4 * n - m) / 2;
	b = n - a;
	if (m % 2 == 1 || a < 0 || b < 0)
		printf("No answer\n");
	else
		printf("%d %d\n", a, b);
	return 0;
}

//三整数排序
//方法一：最简单的思路 使用6条if语句
int main()
{
	int a, b, c;
	scanf_s("%d%d%d", &a, &b, &c);
	if (a <= b && b <= c)  printf("%d %d %d\n", a, b, c);
	else if (a <= c && c <= b)  printf("%d %d %d\n", a, c, b);
	else if (b <= a && a <= c)  printf("%d %d %d\n", b, a, c);
	else if (b <= c && c <= a)  printf("%d %d %d\n", b, c, a);
	else if (c <= a && a <= b)  printf("%d %d %d\n", c, a, b);
	else if (c <= b && b <= a)  printf("%d %d %d\n", c, b, a);
	/* 最后一条语句可以简化成单独的esle
	else printf("%d %d %d", c, b, a);   */
	return 0;
}
//方法二：a<=b<=c的形式（利用三变量交换法）
int main()
{
	int a, b, c, t;
	scanf_s("%d%d%d", &a, &b, &c);
	if (a > b) { t = a;a = b;b = t; }  //执行完毕之后a<=b
	if (a > c) { t = a;a = c;c = t; }  //执行完毕之后a<=c,且a<=b依然成立
	if (b > c) { t = b;b = c;c = t; }
	printf("%d %d %d\n", a, b, c);
	return 0;
}